New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More

bare-http1

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bare-http1

Native HTTP/1 library for JavaScript

4.0.2
latest
Version published
Weekly downloads
1.1K
113.33%
Maintainers
0
Weekly downloads
 
Created

bare-http1

HTTP/1 library for JavaScript.

npm i bare-http1

Usage

const http = require('bare-http1')

const server = http.createServer((req, res) => {
  res.statusCode = 200
  res.setHeader('Content-Length', 10)
  res.write('hello world!')
  res.end()
})

server.listen(0, () => {
  const { port } = server.address()
  console.log('server is bound on', port)

  const client = http.request({ port }, (res) => {
    res.on('data', (data) => console.log(data.toString()))
  })
  client.end()
})

License

Apache-2.0

FAQs

Package last updated on 12 Dec 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts